<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%--    1.for 普通

        for(int i =0 ; i <10 ;i++){
            System.out.println("helloWord"+i)
        }


--%>
    <%
        int num = 10;
        request.setAttribute("num",num);
    %>
<%--    for普通--%>
    <c:forEach begin="1" end="${num}" step="1" var="i">
            <font color="green">HelloWorld + ${i}</font><br/>
    </c:forEach>
<hr/>
    <%-- 2:增强 for
        for(String str : list){
             System.out.println(str);
        }
    --%>
    <%
        List<String> names = new ArrayList<>();
        names.add("baoqiang1");
        names.add("baoqiang2");
        names.add("baoqiang3");
        request.setAttribute("names",names);
    %>
    <c:forEach items="${names}" var="name"  varStatus="status">
        <font color="red">${name}  ${status.count}</font><br/>
    </c:forEach>
</body>
</html>
